#include "../server.hpp"


void t1()
{
    Socket lst_sock;
    lst_sock.CreateServer(8787);
    while(1)
    {
        int newfd = lst_sock.Accept();
        if(newfd < 0)
        {
            continue;
        }
        Socket cli_sock(newfd);
        char buf[1024] = {0};
        int ret = cli_sock.Recv(buf, 1023);
        if(ret < 0)
        {
            cli_sock.Close();
            continue;
        }
        cli_sock.Send(buf, ret);
        cli_sock.Close();
    }
    lst_sock.Close();
}


int main()
{
    t1();

    return 0;
}